/************************************************************************
 * <br>
 * <ul>
 * <li>版权所有：唐山弘川科技有限公司 2009－2020</li>
 * <li>创建日期：2009-8-7</li>
 * <li>初始作者：刘川</li>
 * </ul>
 * <ul>
 * <b>修订历史</b>
 * <li>1、</li>
 * </ul>
 ***********************************************************************/
package org.hy.framework.hibernate.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.hy.enterprise.framework.jpa.core.dao.IPlainDao;
import com.hy.enterprise.framework.jpa.core.entity.Persistable;
import com.hy.enterprise.framework.jpa.core.entity.util.Page;
import com.hy.enterprise.framework.persistence.PersistentException;

/**
 * <ul>
 * <li>设计作者：刘川</li>
 * <li>设计日期：2009-8-7</li>
 * <li>设计时间：下午10:52:19</li>
 * <li>设计目的：表现数据访问对象的接口<br>
 * < PersistentEntity extends Persistable >可以选择继承不同的Identifierable接口实现类<br>
 * 并实现Persistable借口</li>
 * </ul>
 * <ul>
 * <b></b>
 * <li>1、</li>
 * </ul>
 * 
 * @param <X>
 * @param <Y>
 */
// public interface IDao < PersistentEntity extends Persistable >
// public interface IDao < PersistentEntity extends Persistable >
// public interface IHibernatePlainAbstractDao < PersistentEntity extends
// Serializable, X, Y > extends IPlainDao < PersistentEntity , X, Y >
public interface IHibernatePlainAbstractDao<PersistentEntity, X, Y> extends
		IPlainDao<PersistentEntity, X, Y> {
	public SessionFactory getSessionFactory();

	public void setSessionFactory(SessionFactory sessionFactory);

	public Session getHibernateSession();

	public Boolean isExists(PersistentEntity persistentEntity,
			String propertyName, Object propertyValue);

	public Page<PersistentEntity> findPage(String hql)
			throws PersistentException;

	public Page<PersistentEntity> findPage(String hql, Map<String, ?> parameters);

	public Page<PersistentEntity> findPage(String hql, Object... parameters);

	public Page<PersistentEntity> findPage(String hql, int offset, int max,
			Object... parameters);

	public Page<PersistentEntity> findPageByPageNo(String hql, int pageNo);

	public Page<PersistentEntity> findPageByPageNo(String hql, int pageNo,
			Object... parameters);

	public Page<PersistentEntity> findPageByPageNo(String hql, int pageNo,
			int pageSize, Object... parameters);

}
